package com.b.domain;

import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "dynamiccomment")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DynamicComment {
    @Id
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer id;

    /**
    * 动态ID
    */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer dynamicId;

    /**
    * 父评论ID
    */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer parentId;

    /**
    * 用户ID
    */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer userId;

    /**
     * 评论内容
     */
    @Field(type = FieldType.Text, index = true , store = true)
    private String content;

    /**
    * 创建时间
    */
    @Field(type = FieldType.Date, index = false , store = true)
    private Date createdAt;

    /**
    * 更新时间
    */
    @Field(type = FieldType.Date, index = false , store = true)
    private Date updatedAt;

    /**
    * 点赞数
    */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer likeCount;

    /**
    * 回复数
    */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer replyCount;

    /**
    * 是否置顶
    */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer isTop;
}